package eazy;

public class isPalindrome_09 {
    public static void main(String[] args) {

    }
    public static boolean isPalindrome(int x){
//        如果小于零或者是十的整数且不为0
        if (x<0||(x%10==0&&x!=0)){
            return false;
        }
        int revertedNumber =0;
        while (x>revertedNumber){
            revertedNumber=revertedNumber*10+x%10;
            x/=10;
        }
        return x==revertedNumber||x ==revertedNumber/10;
    }
}
